package com.greenline.push.core.pushcenter.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import com.greenline.push.core.pushcenter.DomainManager;
import com.greenline.push.dal.pushcenter.DomainDAO;
import com.greenline.push.dal.pushcenter.dataobject.DomainDO;
import com.greenline.push.dal.query.DomainQuery;

public class DomainManagerImpl implements DomainManager {

	@Autowired
	DomainDAO domainDAO;

	@Override
	public Long insert(DomainDO domainDO) {
		return domainDAO.insert(domainDO);
	}

	@Override
	public DomainDO getDomainById(Long id) {
		return domainDAO.getById(id);
	}

	@Override
	public boolean update(DomainDO domainDO) {
		return domainDAO.update(domainDO) > 0;
	}

	@Override
	public DomainQuery listByQuery(DomainQuery query) {
		return domainDAO.listByQuery(query);
	}

	@Override
	public boolean delete(Long id) {
		return domainDAO.delete(id) > 0;
	}

    @Override
    public List<DomainDO> listAll() {
        return domainDAO.listAll();
    }

    @Override
    public DomainDO getByCode(String code) {
        return domainDAO.getByCode(code);
    }

}
